﻿using System;
using System.Collections;

namespace Program17_3
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] nums = new int[1000];
            ArrayList arr = new ArrayList();
            Random md = new Random();
            while (arr.Count < 1000)
            {
                int tmpNum = md.Next(1, 10000);
                if (!arr.Contains(tmpNum))
                {
                    arr.Add(tmpNum);
                }                
            }
            for (var i = 0; i < nums.Length; i++)
            {
                nums[i] = (int)arr[i];
                Console.Write(nums[i] + " ");
            }
            Console.WriteLine();
            Console.WriteLine("排序后。。");
        }
    }
}
